<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width:100px;
            height:100px;
            background:red;
        }
    </style>
    <script>
        function doOver(obj){
            console.log(obj);
            console.log("鼠标悬浮事件");
        }
        function doOut(){
            console.log("鼠标离开事件");
        }
    </script>
</head>
<body>
    <!-- mouseover鼠标移动到某个元素之上，鼠标悬浮事件 -->
    <!-- mouseout鼠标离开事件 -->

    <!-- this表示触发事件的元素，也称之为事件源 -->
    <div onmouseover="doOver(this)" onmouseout="doOut()">我是div</div>
</body>
</html>